﻿-- Define the relationship between Participant and Person
ALTER TABLE [dbo].[Participant] WITH CHECK ADD  
       CONSTRAINT [FK_Participant_CreatedByPerson] FOREIGN KEY([CreatedBy])
REFERENCES [dbo].[Person] ([PersonId])
ON DELETE NO ACTION
GO
-- Define the relationship between Participant and Activity
ALTER TABLE [dbo].[Participant] WITH CHECK ADD  
       CONSTRAINT [FK_Participant_Activity] FOREIGN KEY([Activity])
REFERENCES [dbo].[Activity] ([ActivityId])
ON DELETE NO ACTION
GO
-- Define the relationship between Participant and Person
ALTER TABLE [dbo].[Participant] WITH CHECK ADD  
       CONSTRAINT [FK_Participant_Person] FOREIGN KEY([Person])
REFERENCES [dbo].[Person] ([PersonId])
ON DELETE NO ACTION
GO
-- Define the relationship between Participant and Person
ALTER TABLE [dbo].[Participant] WITH CHECK ADD  
       CONSTRAINT [FK_Participant_LastChangedBy] FOREIGN KEY([LastChangedBy])
REFERENCES [dbo].[Person] ([PersonId])
ON DELETE NO ACTION
GO
-- Define the relationship between Participant and BusinessRole
ALTER TABLE [dbo].[Participant] WITH CHECK ADD  
       CONSTRAINT [FK_Participant_BusinessRole] FOREIGN KEY([BusinessRole])
REFERENCES [dbo].[BusinessRole] ([RoleId])
ON DELETE NO ACTION
GO